home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1999 Macromedia, Inc. All rights reserved.
-
- //*************** GLOBALS VARS *****************
-
- var HELP_DOC = HELP_cmdSegmentEditor;
-
- var SEG_NAME = '';
- var SEG_TYPE = '';
- var IS_SET = false;
-
- var name = '';
- var type = '';
-
-
- //******************* API **********************
-
- function commandButtons() {
- return new Array(BTN_OK,"cmdOK()",
- BTN_Cancel,"cmdCancel()",
- BTN_Help,"displayHelp()");
- }
-
- function cmdOK() {
- if (applyCommand()) {
- garbageCollect(true);
- window.close();
- }
- }
-
- function cmdCancel() {
- garbageCollect(true);
- window.close();
- }
-
- function applyCommand() {
- SEG_NAME = (name) ? name : LABEL_defaultSegName;
- SEG_TYPE = type;
- IS_SET = true;
- return IS_SET;
- }
-
- function inspectCommand(theName, theSegType) {
- name = theName;
- type = theSegType;
- IS_SET = false;
- }
-
- //***************** LOCAL FUNCTIONS ******************
-
- function initializeUI(){
- var theObj,segKind;
-
- theObj=findObject('segName');
- if (theObj) theObj.value = removeExt(name);
-
- theObj=findObject('segType');
- segKind = (type) ? eval(type) : true;
- if (theObj) theObj[(segKind)?0:1].checked = true;
-
- document.theForm.segName.focus(); //set focus on textbox
- document.theForm.segName.select(); //set insertion point into textbox
- }
-
- function updateUI(theItemName) {
- var theObj;
-
- theObj = findObject(theItemName);
- if (theObj) {
- if (theItemName == 'segName' && removeExt(name) != theObj.value) {
- name = theObj.value;
- name = replaceSub(name, '"', '');
- name = replaceSub(name, "'", '');
- theObj.value = name;
- } else if (theItemName == 'segType') {
- type = (theObj[0].checked) ? "1" : "0";
- }
- }
- }
-
-